﻿<!--#include file="mymin.asp"-->
<%
dim id,classs
id=request.Querystring("id")
classs=request.Querystring("class")
dim rs,sql,p
p=request.Querystring("p")
if p="" then p=1

set Rs=Server.CreateObject("ADODB.Recordset")
Sql="select * from 74hu_link Where ID="&ID
Rs.open Sql,myconn,1,3

if p=1 then%><card title="友链修改"><p>
友链名称:<input name="name<%=time_r%>" value="<%=nowml(rs("name"))%>" maxlength="7"/><br/>
友链简称:<input name="namt<%=time_r%>" value="<%=nowml(rs("namt"))%>" maxlength="4"/><br/>
网站地址:<input name="url<%=time_r%>" value="<%=nowml(rs("url"))%>"/><br/>
友链类别:<select name="classid<%=time_r%>" value="<%=rs("classid")%>"><%
Set rss=Server.CreateObject("ADODB.Recordset")
rss.open "select classid,class from 74hu_linkc",myconn,1,1
While Not rss.eof
	w "<option value="""&rss("classid")&""">"&nowml(rss("class"))&"</option>"
	rss.movenext
Wend
rss.close
Set rss=Nothing
%></select><br/>
友链状态:<select name="active<%=time_r%>" value="<%=rs("active")%>">
<option value="0">通过审核</option>
<option value="1">等待审核</option>
</select><br/>
网站简介:<input name="jian<%=time_r%>" value="<%=nowml(rs("jian"))%>" maxlength="100"/><br/>
<anchor>修改友链
<go href="Edit_link.asp?sid=<%=sid%>&amp;class=<%=classs%>&amp;id=<%=id%>&amp;p=2" method="post" accept-charset="utf-8">
<postfield name="name" value="$(name<%=time_r%>)"/>
<postfield name="namt" value="$(namt<%=time_r%>)"/>
<postfield name="url" value="$(url<%=time_r%>)"/>
<postfield name="jian" value="$(jian<%=time_r%>)"/>
<postfield name="classid" value="$(classid<%=time_r%>)"/>
<postfield name="active" value="$(active<%=time_r%>)"/>
</go></anchor><br/>
<a href="mymin_class.asp?sid=<%=sid%>&amp;id=<%=classs%>&amp;p=2">[友链管理]</a><br/>
<a href="Link_class.asp?sid=<%=sid%>">[分类管理]</a><br/>
<a href='mymin_index.asp?sid=<%=sid%>'>[友链后台]</a>
<%elseif p=2 then%>
<card id="index" title="友链修改结果"><p>
<% dim name,namt,url,jian,brin,brout,active
name=Request.Form("name")
namt=Request.Form("namt")
URL=Request.Form("URL")
jian=Request.Form("jian")
classid=Request.Form("classid")
active=Request.Form("active")
if classid="" Or IsNumeric(classid)=False then Call Error("友链类别不能为空！")
if name="" then Call Error("网站名称不能为空！")
if namt="" then Call Error("网站简称不能为空！")
if len(namt)>4 then Call Error("网站简称最多4字！")
if url="" then Call Error("网站地址不能为空！")
If active<>"0" And active<>"1" Then active="1"
if not (rs.bof and rs.eof) then
	rs("name")=name
	rs("namt")=namt
	rs("URL")=URL
	rs("jian")=jian
	rs("classid")=classid
	rs("active")=active
	rs.update()
	w "成功修改友链！<br/>"
end if
%>
<a href="mymin_class.asp?sid=<%=sid%>&amp;id=<%=classs%>">[友链管理]</a><br/>
<a href="Link_class.asp?sid=<%=sid%>">[分类管理]</a><br/>
<a href='mymin_index.asp?sid=<%=sid%>'>[友链后台]</a>
<%END IF
call Last%>